<template>
  <div ref="myLinecharts" class="warp" />
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: 'LineChartsVue',
  mounted() {
    var myChart = echarts.init(this.$refs.myLinecharts)
    myChart.setOption({
      xAxis: {
        show: false,
        type: 'category'
      },

      yAxis: {
        show: false
      },
      // 表格在中间
      grid: {
        left: 0,
        right: 0,
        bottom: 0,
        top: 0

      },
      series: [
        {
          data: [10, 5, 23, 11, 22, 14, 44],
          type: 'line',
          // 拐点的样式设置
          itemStyle: {
            opacity: 0
          },
          // 线条的样式
          lineStyle: {
            color: 'purple'
          },
          // 填充颜色
          areaStyle: {
            color: {
              type: 'linear',
              x: 0,
              y: 0,
              x2: 0,
              y2: 1,
              colorStops: [{
                offset: 0, color: 'purple' // 0% 处的颜色
              }, {
                offset: 1, color: '#fff' // 100% 处的颜色
              }],
              global: false // 缺省为 false
            }
          }
        }
      ]
    })
  }
}
</script>

<style scoped>
.warp{
  width: 100%;
  height: 50px;
}
</style>
